package com.example.houserental.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.houserental.common.base.BaseService;
import com.example.houserental.entity.House;

import java.util.List;

/**
 * <pre>
 *     记录/页面业务逻辑接口
 * </pre>
 */
public interface HouseService extends BaseService<House, Long> {

    /**
     * 根据条件获得列表
     *
     * @param condition
     * @return
     */
    Page<House> findHouseByCondition(House condition, Page<House> page);


    /**
     * 根据租客userId查询
     *
     * @param userId
     * @return
     */
    Page<House> findByRentUserId(Long userId, Page<House> page);


    /**
     * 获得最新房屋
     *
     * @param cityId
     * @param limit
     * @return
     */
    List<House> getLatestHouse(Long cityId, int limit);

    /**
     * 根据状态统计
     *
     * @param houseStatus 状态
     * @return
     */
    Integer countByStatus(Integer houseStatus);

    /**
     * 获得合租房屋
     *
     * @return
     */
    List<House> getUnionRentHouse(House house);
}
